<?php 	namespace Common\Model;
use Hdphp\Model\Model;
class TyAttr extends Model 
{
	protected $table ="type_attr";
	protected $validate = array(
		array("tyattr_name","required","名称不能为空",3,3),
		array("tyattr_value","required","属性值不能为空",3,3),
	);
	
	public function store($type_id)
	{
		if(!$this->create()) return FALSE;
		$tyattr =$_POST;
		$tyattr['tyattr_type_id'] = $type_id;
		
		
		return $this->add($tyattr);
	}
	public function edit()
	{
		if(!$this->create()) return FALSE;
		
		
		return $this->save();
	}
}

